package com.neulogistics.core.customercenter.domain.service;

import com.neulogistics.core.customercenter.domain.model.aggregate.Order;
import com.neulogistics.core.customercenter.domain.repository.IOrderRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CustomerCenterDomainService implements ICustomerCenterDomainService {
    @Resource
    IOrderRepository orderRepository;

    @Override
    public void placeOrder(Order order) {
        // 领域事件已在创建order对象时生成，现在需要将订单持久化，并发布事件

        // 持久化
        orderRepository.save(order);
    }
}
